package com.nuonuo.nuo_xp;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * @author glsite.com
 * @version $Rev$
 * @des ${TODO}
 * @updateAuthor $Author$
 * @updateDes ${TODO}
 */
public class SHA {
    private static String jiami_text="nuonuo";
    public static String get_sha_1() throws Exception {

        MessageDigest md = MessageDigest.getInstance("SHA-1");
        md.update(jiami_text.getBytes());
        return Utils.byteToHexString(md.digest());
    }

    public static String get_sha_2(){
        try {
            MessageDigest md = MessageDigest.getInstance("SHA-1");
            md.update(jiami_text.getBytes(), 2, 3);
            return Utils.byteToHexString(md.digest("123456".getBytes()));

        }catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
            return null;

    }
}}